package zuoye3;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

    public class Test {
        public static void main(String[] args) {
            List<Student> students = new ArrayList<>();
            Student zhangsan = new Student("张三",20,90.0f);
            Student lisi = new Student("李四",22,90.0f);
            Student wangwu = new Student("王五",20,95.0f);
            Student zhaoliu = new Student("赵六",22,100.0f);
            Student tianqi = new Student("田七",26,87.0F);
            students.add(zhangsan);
            students.add(lisi);
            students.add(wangwu);
            students.add(zhaoliu);
            students.add(tianqi);
            Collections.sort(students, new ScoreAndAgeComparator());

            System.out.println("姓名\t年龄\t分数");
            students.forEach(Student::show);
        }
    }


